package cn.walls1717.mapper;

import cn.walls1717.domain.Role;
import cn.walls1717.domain.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * @author CJ
 * @date 2020/8/10
 */
public interface UserMapper {

    /**
     * 查询
     * @param username 。
     * @return 。
     * @throws Exception 。
     */
    UserInfo findByUsername(String username) throws Exception;

    List<UserInfo> findAll() throws Exception;

    void save(UserInfo userInfo) throws Exception;

    UserInfo findById(String id) throws Exception;

    List<Role> findOtherRoles(String userId) throws Exception;

    void addRoleToUser(@Param("userId") String userId, @Param("roleId") String roleId) throws Exception;
}
